package cate.game.client.interceptor;

import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.MsgInput;
import cate.game.client.request.ClientRequestHandler;
import cate.game.log.GameLoggerFactory;
import org.slf4j.Logger;

public class CountReqsInterceptor extends AbstractCommandInterceptor{
    @Override
    public void execute(MsgInput msgInput, GameBody gameBody, ClientContext clientContext) {
        ClientRequestHandler.countReqs(msgInput.getClass().getName());
        try {
            next.execute(msgInput, gameBody, clientContext);
        } catch (Exception e) {
            Logger log = GameLoggerFactory.getLogger(gameBody, CountReqsInterceptor.class);
            log.error("处理请求{}异常 : ",msgInput.getClass().getName(), e);
        }
    }
}
